const { Controller } = require('egg');
// Please install OpenAI SDK first: `npm install openai`

const OpenAI = require('openai');

const openai = new OpenAI({
        baseURL: 'https://api.deepseek.com',
        apiKey: 'sk-f784d8c63ad2491390c3ce0a583133e9'
});

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    const msg = ctx.request.body;
    console.log(msg)
    // const completion = await openai.chat.completions.create({
    //   messages: [{ role: "system", content: "请帮忙出一份餐饮店长培训资料" }],
    //   model: "deepseek-chat",
    // });
    // ctx.body = completion.choices[0].message.content;
  }
}

module.exports = HomeController;
s